package com.yamed.bus.service.kakfa;

import com.alibaba.fastjson.JSONObject;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: wchen
 * @Description:
 * @Date: Created in 2019-08-13 10:42
 * Copyright 本内容仅限于杭州阿拉丁信息科技股份有限公司内部传阅，禁止外泄以及用于其他的商业目的
 */
@Component
public class KafkaProducer {

    @Resource
    private KafkaTemplate kafkaTemplate;

    public void sendMsg(String topic, JSONObject jsonObject){
        kafkaTemplate.send(topic, jsonObject.toJSONString());
    }

}
